home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / bbs / cddk9606.zip / TUTOR.ARJ / TUTOR5.PAS < prev    next >
Pascal/Delphi Source File  |  1996-06-06  |  1KB  |  60 lines

  1.  
  2. PROGRAM Tutor5;
  3.  
  4. {$A+,B-,F+,I-,Q-,R-,S-,X+}
  5.  
  6. USES
  7.   Concerto, IO, Scripts, Types, xStrings;
  8.  
  9. { This version is nearly identical to TUTOR4.PAS, except that the prompts
  10.   are now stored as typed constants.  This allows you to easily change
  11.   them if needed.  }
  12.  
  13. CONST
  14.   Prompt  : pChar40 = 'And on this day, he spoke: ';
  15.   TooHigh : pChar80 = 'Your eyes are toward the heavens, esteemed one.~|';
  16.   TooLow  : pChar80 = 'Your feet forever touch the earth, O Great One!~|';
  17.   Winner  : pChar80 = 'You have ascended to the heavens!~|~p';
  18.  
  19.  
  20. VAR
  21.   Entry  : pChar3;
  22.   Number : Byte;
  23.  
  24.  
  25. BEGIN
  26.  
  27. { Setup the door }
  28.  
  29. RegisterConcerto;        { Setup Concerto                }
  30. Script('Init');          { Run the initialization script }
  31. SO_ClrScr;               { Clear the screen              }
  32. Number:=Random(100)+1;   { Select a random number        }
  33.  
  34. REPEAT
  35.  
  36.   { The next section is described in TUTOR4.PAS }
  37.  
  38.   SO_pChar(Prompt);
  39.   Entry[0]:=#0;
  40.   SI_pChar(Entry,3);
  41.  
  42.   SO_CRLF; { Send a carriage-return/line-feed sequence }
  43.  
  44.  
  45.   { Check the answer... }
  46.  
  47.   IF p_Int(Entry)=Number THEN
  48.     BEGIN
  49.     SO_pCharLn(Winner);
  50.     ExitDoor(0);
  51.     END
  52.   ELSE
  53.     IF p_Int(Entry)>Number THEN
  54.       SO_pCharLn(TooHigh)
  55.     ELSE
  56.       SO_pCharLn(TooLow);
  57.  
  58. UNTIL False;
  59. END.
  60.